package gui;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.Color;
import java.awt.GridBagLayout;
import javax.swing.JPanel;
import javax.swing.JLabel;
import javax.swing.table.DefaultTableModel;

import java.awt.Rectangle;
import java.awt.Font;
import java.sql.SQLException;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import com.jgoodies.forms.factories.DefaultComponentFactory;

public class studFeedbackGUI extends JPanel{
	TeacherMainMenuGUI tmmc;
	private JTextField textField;
	JLabel label;
	JLabel label_1;
	JLabel lblNewLabel_1;
	JButton btnComment;
	JButton btnFeedback;
	JButton btnBack;
	String assID;
	JLabel lblNotexists;
	
	public studFeedbackGUI() {
		super();
		initialize();
	}
	
	private void initialize() {
		this.setSize(900,600);
		SpringLayout springLayout = new SpringLayout();
		setLayout(springLayout);
		
		JLabel lblNewLabel = new JLabel(" Student Information ");
		lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 16));
		lblNewLabel.setForeground(Color.BLUE);
		springLayout.putConstraint(SpringLayout.WEST, lblNewLabel, 95, SpringLayout.WEST, this);
		add(lblNewLabel);
		
		JLabel lblStudentId = new JLabel("Student ID");
		lblStudentId.setFont(new Font("Tahoma", Font.PLAIN, 15));
		lblStudentId.setForeground(Color.BLUE);
		springLayout.putConstraint(SpringLayout.SOUTH, lblNewLabel, -29, SpringLayout.NORTH, lblStudentId);
		springLayout.putConstraint(SpringLayout.SOUTH, lblStudentId, -516, SpringLayout.SOUTH, this);
		add(lblStudentId);
		
		JLabel lblStudentName = new JLabel("Student name");
		lblStudentName.setFont(new Font("Tahoma", Font.PLAIN, 15));
		lblStudentName.setForeground(Color.BLUE);
		springLayout.putConstraint(SpringLayout.NORTH, lblStudentName, 27, SpringLayout.SOUTH, lblStudentId);
		springLayout.putConstraint(SpringLayout.WEST, lblStudentName, 0, SpringLayout.WEST, lblStudentId);
		add(lblStudentName);
		
		label = new JLabel("sId");
		label.setFont(new Font("Tahoma", Font.PLAIN, 15));
		springLayout.putConstraint(SpringLayout.EAST, lblStudentId, -46, SpringLayout.WEST, label);
		springLayout.putConstraint(SpringLayout.NORTH, label, 0, SpringLayout.NORTH, lblStudentId);
		springLayout.putConstraint(SpringLayout.EAST, label, -617, SpringLayout.EAST, this);
		add(label);
		
		label_1 = new JLabel("sName");
		label_1.setFont(new Font("Tahoma", Font.PLAIN, 15));
		springLayout.putConstraint(SpringLayout.WEST, label, 0, SpringLayout.WEST, label_1);
		springLayout.putConstraint(SpringLayout.NORTH, label_1, 0, SpringLayout.NORTH, lblStudentName);
		springLayout.putConstraint(SpringLayout.WEST, label_1, 198, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.EAST, label_1, 41, SpringLayout.EAST, lblNewLabel);
		add(label_1);
		
		lblNewLabel_1 = new JLabel("Select the option that you interested in:");
		springLayout.putConstraint(SpringLayout.NORTH, lblNewLabel_1, 105, SpringLayout.SOUTH, label);
		springLayout.putConstraint(SpringLayout.WEST, lblNewLabel_1, 271, SpringLayout.WEST, this);
		add(lblNewLabel_1);
		
		btnComment = new JButton("comment");
		
		springLayout.putConstraint(SpringLayout.NORTH, btnComment, 56, SpringLayout.SOUTH, lblNewLabel_1);
		springLayout.putConstraint(SpringLayout.WEST, btnComment, 0, SpringLayout.WEST, lblNewLabel_1);
		add(btnComment);
		
		btnFeedback = new JButton("feedback");
		
		springLayout.putConstraint(SpringLayout.NORTH, btnFeedback, 0, SpringLayout.NORTH, btnComment);
		springLayout.putConstraint(SpringLayout.EAST, btnFeedback, 0, SpringLayout.EAST, lblNewLabel_1);
		add(btnFeedback);
		
		btnBack = new JButton("back");
		
		springLayout.putConstraint(SpringLayout.WEST, btnBack, 133, SpringLayout.WEST, this);
		springLayout.putConstraint(SpringLayout.SOUTH, btnBack, -124, SpringLayout.SOUTH, this);
		add(btnBack);
		
		lblNotexists = new JLabel("File Not Exists");
		lblNotexists.setIcon(new ImageIcon(studFeedbackGUI.class.getResource("/com/sun/java/swing/plaf/windows/icons/Warn.gif")));
		lblNotexists.setForeground(Color.RED);
		springLayout.putConstraint(SpringLayout.NORTH, lblNotexists, 41, SpringLayout.SOUTH, btnComment);
		springLayout.putConstraint(SpringLayout.WEST, lblNotexists, 279, SpringLayout.WEST, this);
		add(lblNotexists);
		lblNotexists.setVisible(false);
	
	}
	
		public JLabel getlabel(){
			return this.label;	
		}
		
		public void setlabel(String s1,String s2,String s3)
		{
			label.setText(s1);
			label_1.setText(s2+"  "+s3);
		}
		public void setlabel(String s1)
		{
			assID=s1;
		}
		public void setLableNotExists()
		{
			this.lblNotexists.setVisible(true);
		}
		public void updateLableNotExists()
		{
			lblNotexists.setVisible(false);
		}
}
